package cn.blt.core.article.controller;


import cn.blt.common.BaseController;
import cn.blt.common.BaseEntity;
import cn.blt.core.article.entity.BlogTypeEntity;
import cn.blt.core.article.service.BlogTypeService;
import cn.blt.common.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 博客类型
 * @author run
 * @date 2022/08/25
 */
@RestController
@RequestMapping("/blogTypeController")
public class BlogTypeController extends BaseController {

    @Resource
    private BlogTypeService typeService;

    @ApiOperation(value = "添加类型")
    @PostMapping("saveType")
    public Result saveType(@RequestBody BlogTypeEntity typeDetails){
        return typeService.saveType(typeDetails);
    }

    @ApiOperation(value = "分页显示博客类型")
    @GetMapping("queryBlogType")
    public Result queryBlogType(BaseEntity entity){
        return typeService.queryBlogType(entity);
    }

}

